package com.lagou.session;

import java.sql.SQLException;
import java.util.List;

/**
 * @ClassName: SqlSession
 * @Auther: Jerry
 * @Date: 2020/6/20 9:07
 * @Desctiption: TODO
 * @Version: 1.0
 */
public interface SqlSession {

    <T> List<T> selectList(String statementId, Object... params) throws Exception;

    <T> T selectOne(String statementId, Object... params) throws Exception;

    int insert(String statementId, Object... params) throws ClassNotFoundException, SQLException, NoSuchFieldException, IllegalAccessException, InstantiationException;

    int update(String statementId, Object... params) throws ClassNotFoundException, SQLException, NoSuchFieldException, IllegalAccessException, InstantiationException;

    int delete(String statementId, Object... params) throws ClassNotFoundException, SQLException, NoSuchFieldException, IllegalAccessException, InstantiationException;

    <T> T getMapper(Class<?> mapperClass);

    void close() throws SQLException;
    void commit() throws SQLException;
    void rollback() throws SQLException;
}
